<?php
class UserExt extends Base
{
    public static $user;
    public static $uid;
    public static function getNickByUid($uid){
        if(self::$uid == $uid && self::$user){
            return  self::$user->nick;
        }

        $nick = myredis::get("nickOf".$uid);
        if(!$nick){
            self::$user = new User();
            self::$user->find($uid);
            $nick = self::$user->nick;
            myredis::set("nickOf".$uid,$nick,3600);
        }

        return $nick;
    }

}